Dynomotion

Group: DynoMotion Message: 1252 From: davidchoong@ymail.com Date: 6/4/2011
Subject: KFLOP + KANALOG For Mach3 Mill (Homing by Encoder Ref. Point)
Hi TK,

My DIY CNC having Encoder with Ref. Point at the mid of Encoder and I'm using this for Homing. How do I go about on your "HomeEncoderMach3" modification on:

1. if the position of Dest(X) is at Positive Side and the Move(X) will move in Negative direction and stop at the Encoder Ref. Point.

2. 1. if the position of Dest(X) is at Negative Side and the Move(X) will move in Positive direction and stop at the Encoder Ref. Point.

Would appreciate your kind reply.

Thanks and regards.

From:
David Choong
Group: DynoMotion Message: 1254 From: Tom Kerekes Date: 6/4/2011
Subject: Re: KFLOP + KANALOG For Mach3 Mill (Homing by Encoder Ref. Point)
Hi David,
 
Well on initial power up the system will not know where it is at so it is not able to tell which direction to go to find the index pulse.  After homing once if you need to home again it will probably work.  A stratagey might be to make a guess at which direction to go and if you hit a limit switch before detecting the index pulse then reverse and try the other way.  Does your system have home or limit switches?  The code might be something like:
 
 
int HomingDir,Done=0;
 
if (ch0->Dest > 0.0)  // guess which direction to try
    HomingDir = -1;
else
    HomingDir = 1;
 
 
 
while (!Done)  // repeat until finished
{
    Jog(0,1000*HomingDir);
 
    // loop checking for index pulse or Limit
    while (!ReadBit(LIMITX))
    {
        if (ReadBit(INDEXX))
        {
            Jog(0,0);   // stop
            while (!CheckDone(0)) ; // wait till stopped
            Zero(0);
            Done=1;
        }
    }
    HomingDir = -HomingDir;   // Reverse Dir
}
 
 
TK


--- On Sat, 6/4/11, davidchoong@... <davidchoong@...> wrote:

From: davidchoong@... <davidchoong@...>
Subject: [DynoMotion] KFLOP + KANALOG For Mach3 Mill (Homing by Encoder Ref. Point)
To: DynoMotion@yahoogroups.com
Date: Saturday, June 4, 2011, 8:35 PM

 
Hi TK,

My DIY CNC having Encoder with Ref. Point at the mid of Encoder and I'm using this for Homing. How do I go about on your "HomeEncoderMach3" modification on:

1. if the position of Dest(X) is at Positive Side and the Move(X) will move in Negative direction and stop at the Encoder Ref. Point.

2. 1. if the position of Dest(X) is at Negative Side and the Move(X) will move in Positive direction and stop at the Encoder Ref. Point.

Would appreciate your kind reply.

Thanks and regards.

From:
David Choong

Group: DynoMotion Message: 1255 From: David Choong Date: 6/5/2011
Subject: Re: KFLOP + KANALOG For Mach3 Mill (Homing by Encoder Ref. Point)

Hi TK,

 

Thank for your help.....I performed Homing before turning off the machine, then turn on and performed Homing again and worked well to what I'm looking for. To be sure that  X Axis alway getting the Encoder  index pulse during homing, I'm still having the Move(X) on your "HomeEncoderMach3".   

 

if (flags & 1)

     {

           int HomingDir,Done=0;

           if (ch0->Dest>0.0)

                HomingDir=-1;

           else

                HomingDir=1;

          

           DisableAxis(X);

           Zero(X);

           EnableAxisDest(X,0.0);

 

           Move(X,-12000*HomingDir);

           while(!CheckDone(X)) ;

           Zero(X);

                    

           Jog(X,4000*HomingDir); // start moving

           while (!ReadBit(128)); // wait for switch (input #128) to change

           Jog(X,0);             // StopMotion

          

           while(!CheckDone(X)) ;

           Delay_sec(2.0);

          

           DisableAxis(X);

           Zero(X);

           EnableAxisDest(X,0.0);

     }   

 

Thanks and regards.

 

From:

David Choong